<%@page import="com.alphaking.constant.CategoryConstant"%>
<%@page import="com.alphaking.util.DataConvertorUtil"%>
<%@ page language="java" import="com.alphaking.pojo.client.*"
	contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>生活邦荟后台管理系统</title>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/resources/common/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/resources/admin/css/bootstrap-responsive.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/resources/admin/css/backstage_common.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/resources/common/css/iconfont.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/resources/admin/css/classifyProduct.css" />
</head>
<body>
    <c:set var="ISUNKNOW_FALSE" value="<%=CategoryConstant.ISUNKNOW_FALSE %>"> </c:set>
    <c:set var="ISUNKNOW_TRUE" value="<%=CategoryConstant.ISUNKNOW_TRUE %>"> </c:set>
	<!--顶部  -->
	<jsp:include page="./navbar.jsp"></jsp:include>

	<div class="container-fluid-full">
		<div class="row-fluid">
			<!--侧边栏-->
			<jsp:include page="./container-fluid-full.jsp"></jsp:include>
			<!--主要内容-->
				<!--主要内容-->
				<div class="span10" id="content" style="">
					<div class="row-fluid">
						<button class="btn btn-info" id="choseImg">创建一级分类</button>
						<table class="table table-striped table-hover text-left img-list">
							<thead>
								<tr>
									<th class="col-7">分类名称</th>
									<th class="col-4">操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach var="item" items="${pagerResult.resultSet}" varStatus="idxStatus">
									<tr id="${item.productCategoryId}">
									<c:if test="${item.isUnknow eq ISUNKNOW_TRUE }">
											<td class="img-href click" >${item.productCategoryName}</td>	
									</c:if>
									<c:if test="${item.isUnknow ne ISUNKNOW_TRUE }">
										<td class="img-href click">${item.productCategoryName}</td>
										<td  data-isHidden="${item.isHidden}" data-parent="${item.parentCategoryId }">
											<button class="btn btn-warning change">修改</button>
											<button class="btn btn-info deleteCategoryJiLian">删除</button>								    
											
											<c:if test="${item.isHidden==0 }">
											<button class="btn btn-danger delete" id="delete"
												onclick="del(this)">隐藏</button>											
											</c:if>	
											<c:if test="${item.isHidden==1 }">
											<button class="btn btn-danger delete" id="delete"
												onclick="del(this)">显示</button>											
											</c:if>												
										</td>
									</c:if>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<c:choose>
							<c:when test="${pagerResult.count<=0 }">
								<div align="center">沒有数据了</div>
							</c:when>
							<c:when test="${pagerResult.count>0 && pagerResult.currentPage!=null }">
								<div class="page_container">
									<ul class="page">
										<li><a>总记录数：<span>${pagerResult.count}</span>条
										</a></li>
										<li><a class="" id="firstPage"
											onclick='findByPage(${pagerResult.firstPage})'>首页</a></li>
										<li><a class="" id="prepage"
											onclick="findByPage(${pagerResult.previousPage})">上一页</a></li>
										<li><a> <select onchange="pageChange(this)">
				
													<c:forEach var="page" items="${pagerResult.pageList}">
				
														<c:if test="${pagerResult.currentPage==page}">
															<option value="${page}" selected="selected">${page}</option>
														</c:if>
														<c:if test="${pagerResult.currentPage!=page}">
															<option value="${page}">${page}</option>
														</c:if>
				
													</c:forEach>
				
											</select>
										</a></li>
										<li><a class="" id="nextpage"
											onclick="findByPage(${pagerResult.nextPage})">下一页</a></li>
										<li><a class="" id="lastPage"
											onclick="findByPage(${pagerResult.totalPage})">尾页</a></li>
										<li><a> 总页数：<span>${pagerResult.totalPage}</span>页
										</a></li>
									</ul>
								</div>
							</c:when>
						</c:choose>
					</div>
				</div>
		</div>
	</div>

	<input type="text" style="display: none" id="firstPage"
		value='${pagerResult.firstPage }'>
	<input type="text" style="display: none" id="previousPage"
		value='${pagerResult.previousPage }'>		
	<input type="text" style="display: none" id="nextPage"
		value='${pagerResult.nextPage }'>
	<input type="text" style="display: none" id="lastPage"
		value='${pagerResult.lastPage }'>	
	<!--隐藏  -->	
	<input type="text" style="display: none" id="priority">
	<input type="text" style="display: none" id="imageContainerId">
	
	<!--弹出框  -->
	<div class="upLoadContainer" id="upLoadContainer">
		<div class="upLoad_header" id="upload_Container">图片上传</div>
		<div class="upLoad_content" id="add_content">
			<img id="ImgContainer">
			<button id="ImgUpLoad"><i class="iconfont">&#xe62e;</i> 选择图片</button>
		</div>
		<!--要上传的图片，先隐藏起来  -->
		<input type="button" name="file" id="uploadImage" style="display: none">
		<input type="text" value="" class="imgHref" name=""
			placeholder="请输入分类名" id="categoryName" />	
		<button class="btn btn-info submitImg" id="add">确定</button>	
	</div>	
</body>

<script
	src="<%=request.getContextPath()%>/resources/common/js/jquery-1.9.1.min.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/common/js/common.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/common/js/bootstrap.min.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/admin/js/admin.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/admin/js/qiniu.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/admin/js/plupload.full.min.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/admin/js/plupload.min.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/common/js/pager.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/admin/interactive/category.js"></script>
<script
	src="<%=request.getContextPath()%>/resources/admin/js/classifyProduct.js"></script>
</html>

